package smu.KYBank.test;

import smu.KYBank.DBHandler;
import smu.KYBank.KYBtransfer;
import android.database.Cursor;
import android.test.ActivityInstrumentationTestCase2;
import android.test.TouchUtils;
import android.view.KeyEvent;
import android.widget.EditText;

public class KYBTransferTest1 extends
		ActivityInstrumentationTestCase2<KYBtransfer> {
	private KYBtransfer mActivity;
	private EditText t_acnt, t_money;
	private String login_id, balance, r_bal;
	private int money, sum, r_sum;


	public KYBTransferTest1() {
		super("smu.KYBank", KYBtransfer.class);
	}
		
		
	protected void setUp() throws Exception {
		super.setUp();
		mActivity = this.getActivity();
		t_acnt = (EditText) mActivity.findViewById(smu.KYBank.R.id.t_acnt);
		t_money = (EditText) mActivity.findViewById(smu.KYBank.R.id.t_money);
	}
	
	public void testAccountExistCheck() {
		DBHandler dbhandler = DBHandler.open(mActivity);
		login_id = "kyong";
		Cursor cursor = dbhandler.select_id(login_id + "	");
		TouchUtils.tapView(this, t_acnt);
		sendKeys(KeyEvent.KEYCODE_1, KeyEvent.KEYCODE_0, KeyEvent.KEYCODE_0, KeyEvent.KEYCODE_5);
		assertTrue(mActivity.accountExistCheck());
	}

}
